import axios from './axios'
import qs from 'qs'
import {baseUrl} from '@/config/config'

export const importDept = (data) => {
  return new Promise((resolve, reject) => {
      axios({
          url: baseUrl + '/bdc/api/app/school/' + data.schoolId + '/depts',
          method: 'post',
          data: data.body
      }).then(res => {
        resolve(res)
      }).catch(err => {
        reject(err)
      })
  })
}

export const getDept = (params) => {
  return new Promise((resolve, reject) => {
      axios({
          url: baseUrl + '/bdc/api/app/school/' + params.schoolId + '/depts',
          method: 'get',
          params
      }).then(res => {
        resolve(res)
      }).catch(err => {
        reject(err)
      })
  })
}
